	
	cap log close

*******************************************************************
/* title: eodb_replication_analysis_robustness_2_post_coup_redistribution.do */
/* description: replicating analysis from economic origins of dictatorship and democracy */
/* authors: dan slater, ben smith, gautam nair */
*******************************************************************

	clear
	set mem 500m
	set more off
	pause on 
	vers 10.0

*******************************************************************
* SET DIRECTORY & USE DATASET
*******************************************************************

	* set directory to folder containing replication data
	* cd ""
	use "eodb_replication_data.dta"

*******************************************************************
* DIRECT TAXES SHARE OF GDP
*******************************************************************

	* defining controls
	# delimit ;
	local controls_subset
	wdi_ny_gdp_mktp_kd_zg 
	pwt_lngdppc
	undp_manufacturing_share 
	wdi_ny_gdp_totl_rt_zs 
	wdi_log_population 
	wdi_sp_pop_dpnd_ol
	pwt_openk
	region_democ_cgv_gwf
	time_trend_linear 
	time_trend_quadratic 
	time_trend_cubic
	;
	# delimit cr

	foreach num in 5 3 1 {
		di "* level of direct taxes: full sample `num' time horizon'"
		eststo: xtreg am_inc_gdp_ratio 	coup_success_gwf_l`num' `controls_subset', 
		di "* level of direct taxes: authoritarian regime `num' time horizon'" 
		eststo: xtreg am_inc_gdp_ratio coup_success_gwf_l`num' `controls_subset' if cgv_democracy==0, 
		di "* change in direct taxes: full sample `num' time horizon'"
		eststo: xtreg am_inc_gdp_ratio_p5 coup_success_gwf_l`num' `controls_subset', fe
		di "* change in direct taxes: authoritarian regime `num' time horizon'" 
		eststo: xtreg am_inc_gdp_ratio_p5 coup_success_gwf_l`num' `controls_subset' if cgv_democracy==0, 
	}

*******************************************************************
* SOCIAL SPENDING SHARE OF GDP
*******************************************************************

	* defining controls
	# delimit ;
	local controls_all
	coup_success_gwf_l5
	wdi_ny_gdp_mktp_kd_zg 
	pwt_lngdppc
	undp_manufacturing_share 
	wdi_ny_gdp_totl_rt_zs 
	wdi_log_population 
	wdi_sp_pop_dpnd_ol
	pwt_openk
	region_democ_cgv_gwf
	time_trend_linear 
	time_trend_quadratic 
	time_trend_cubic
	;
	# delimit cr

	* level of social spending: full sample
	eststo: xtreg  am_social_spend_gdp `controls_all', fe
 	* level of social spending: democracy
	eststo: xtreg  am_social_spend_gdp `controls_all' if cgv_democracy==0, fe
	* change in social spending: full sample
	eststo: xtreg  am_social_spend_gdp_p5 `controls_all', fe
	* change in social spending: democracies
	eststo: xtreg  am_social_spend_gdp_p5 `controls_all' if cgv_democracy==0, fe

*******************************************************************
* GOVERNMENT SHARE OF GDP
*******************************************************************

	* defining controls
	# delimit ;
	local controls_all
	coup_success_gwf_l5
	wdi_ny_gdp_mktp_kd_zg 
	pwt_lngdppc
	undp_manufacturing_share 
	wdi_ny_gdp_totl_rt_zs 
	wdi_log_population 
	wdi_sp_pop_dpnd_ol
	pwt_openk
	region_democ_cgv_gwf
	time_trend_linear 
	time_trend_quadratic 
	time_trend_cubic
	;
	# delimit cr

	* government share of gdp: full sample
	eststo: xtreg  pwt_kg `controls_all', fe
 	* government share of gdp: democracy
	eststo: xtreg  pwt_kg `controls_all' if cgv_democracy==0, fe
	* change in government share of gdp: full sample
	eststo: xtreg  pwt_kg_p5 `controls_all', fe
	* change in government share of gdp: democracies
	eststo: xtreg  pwt_kg_p5 `controls_all' if cgv_democracy==0, fe

	estout using "eodb_replication_analysis_robustness_2_post_coup_redistribution.xls", replace cells(b(fmt(%9.3f) star) se(par(`"="("' `")""') fmt(3)) ) stats(N N_clust, fmt(0 0)) style(tab) starlevels(* 0.10 ** 0.05 *** 0.01)  eform

*******************************************************************
* LOG CLOSE
*******************************************************************
	
	* log close

